﻿using System.ServiceModel;
using JTLeigh.Commerce.Spencer.Core.Service.Contracts;
using JTLeigh.Commerce.Spencer.Features.ProductImages.Service.Contracts.Runtime.Common;
using JTLeigh.Commerce.Spencer.Features.ProductImages.Service.Contracts.Runtime.GetProductImages;
using JTLeigh.Commerce.Spencer.Features.ProductImages.Service.Contracts.Runtime.GetProductImageSnapshot;
using JTLeigh.Commerce.Spencer.Features.ProductImages.Service.Contracts.Runtime.GetProductImageSummaries;

namespace JTLeigh.Commerce.Spencer.Features.ProductImages.Service.Contracts
{

	/// <summary>
	/// WCF service interface for the Product Images service.
	/// </summary>
    [ServiceContract(Name = "ProductImagesRuntimeService", Namespace = "http://schemas.jtleigh.com/Commerce/Spencer/Features/ProductImages/1.0/")]
    public interface IProductImagesRuntimeService
	{

		#region Methods

		/// <summary>
		/// Gets all images for a single product, including all views and sizes.
		/// </summary>
		/// <param name="request">The <see cref="GetProductImagesRequest"/> request object.</param>
		/// <returns>The <see cref="GetProductImagesResponse"/> response object.</returns>
		/// <remarks>
		/// <para>
		/// This operation also gets all view and size information relevant to the images returned.
		/// </para>
		/// <para>
		/// Use this operation when you need to display all images for a single product (e.g. on
		/// an &quot;Other Views&quot; page).
		/// </para>
		/// </remarks>
        [OperationContract(Name = "GetProductImages")]
		[FaultContract(typeof(InternalErrorFault))]
		GetProductImagesResponse GetProductImages(GetProductImagesRequest request);

		/// <summary>
		/// Gets a single image for a single product, view, and size combination.
		/// </summary>
		/// <param name="request">The <see cref="GetProductImageSnapshotRequest"/> request object.</param>
		/// <returns>The <see cref="GetProductImageSnapshotResponse"/> response object.</returns>
		/// <remarks>
		/// <para>
		/// This operation also gets a subset of the size information relevant to the image 
		/// returned, and the number of other views and sizes available for the product requested.
		/// </para>
		/// <para>
		/// Use this operation when you need to display a single image for a single product, view,
		/// and size combination (e.g. on a &quot;Product Details&quot; page) and when you need to
		/// know if there are other views and sizes available for the product (e.g. to know when to
		/// display &quot;See Other Views&quot; or &quot;See Other Sizes&quot; hyperlinks).
		/// </para>
		/// </remarks>
        [OperationContract(Name = "GetProductImageSnapshot")]
		[FaultContract(typeof(UnknownProductImageViewFault))]
		[FaultContract(typeof(UnknownProductImageSizeFault))]
		[FaultContract(typeof(InternalErrorFault))]
		GetProductImageSnapshotResponse GetProductImageSnapshot(GetProductImageSnapshotRequest request);

		/// <summary>
		/// Gets a single image per product for multiple products for a single view and size 
		/// combination.
		/// </summary>
		/// <param name="request">The <see cref="GetProductImageSummariesRequest"/> request object.</param>
		/// <returns>The <see cref="GetProductImageSummariesResponse"/> response object.</returns>
		/// <remarks>
		/// <para>
		/// This operation also gets a subset of the size information relevant to the image 
		/// returned.
		/// </para>
		/// <para>
		/// Use this operation when you need to display a single image per product for multiple 
		/// products for a single view and size combination (e.g. on a &quot;Category&quot; or
		/// &quot;Search Results&quot; page).
		/// </para>
		/// </remarks>
        [OperationContract(Name = "GetProductImageSummaries")]
		[FaultContract(typeof(UnknownProductImageViewFault))]
		[FaultContract(typeof(UnknownProductImageSizeFault))]
		[FaultContract(typeof(InternalErrorFault))]
		GetProductImageSummariesResponse GetProductImageSummaries(GetProductImageSummariesRequest request);

		#endregion // Methods

	}

}
